package cn.com.bonc.khjy.date.mapper.dataSource2;

import cn.com.bonc.khjy.bean.Activity;
import cn.com.bonc.khjy.bean.Channel;
import cn.com.bonc.khjy.bean.Product;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Component;

import java.util.List;
import java.util.Map;

@Mapper
public interface CommonMapper2 {

    //  @Insert("INSERT INTO epm_activity_info_push(activity_code,cust_group_id,asset_integ_id,recommend_description,channel_description,activity_type,latn_id) VALUES (#{activity_code},#{cust_group_id},#{asset_integ_id},#{recommend_description},#{channel_description},#{activity_type},#{latn_id})")
     int insertActivity( Activity activity );

     // @Insert("INSERT  INTO epm_activity_info_channel(cust_group_id,channel_id,channel_name) VALUES  (#{cust_group_id},#{channel_id}),#{channel_name})")
     int insertChannel( Channel channel );

     // @Insert("INSERT  INTO epm_activity_info_products(cust_group_id,product_id,product_name) VALUES (#{cust_group_id},#{product_id},#{product_name})")
     int insertProduct( Product product );

     @Select("SELECT * FROM field_info")
     @ResultType(Map.class)
     List<Map<String, Object>> getAllField();

     @Insert("INSERT INTO activity_bind_field(activity_code,bind_field_name,create_time) VALUES(#{activityCode},#{fieldName},NOW())")
     int insertFieldBindInfo( @Param( "activityCode" ) String activityCode, @Param( "fieldName" ) String fieldName );
}
